package org.wang.web.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

public class InitServlet extends HttpServlet {

	private static final long serialVersionUID = -984530876860435785L;
	
	private String localIp;
	
	private String name;
	
	private int age;

	@Override
	public void init() throws ServletException {
		this.setLocalIp(this.getInitParameter("localIp"));
		this.setName(this.getInitParameter("name"));
		this.setAge(new Integer(this.getInitParameter("age")));
		System.out.println("Init Servlet");
		
		System.out.println("localI:"+localIp);
		System.out.println("name::"+name);
	
	}

	public String getLocalIp() {
		return localIp;
	}

	public void setLocalIp(String localIp) {
		System.out.println("setIp");
		this.localIp = localIp;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		System.out.println("setName");
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}
	
}
